<template>
  <a-spin :spinning="confirmLoading">
    <a-form-model ref="form" :model="models" :rules="validatorRules">
      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="topic" required label="论文题目">
        <a-textarea :rows="3" v-model="models.topic" placeholder="大数据背景下语言模型综述" />
      </a-form-model-item>
      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="keyword" required label="论文关键词">
        <a-textarea :rows="5" v-model="models.keyword" placeholder="大数据，深度学习，训练成本" />
      </a-form-model-item>
    </a-form-model>
  </a-spin>
</template>

<script>
// import IndexChart from './IndexChart'
// import IndexTask from "./IndexTask"
// import IndexBdc from './IndexBdc'
import { mapGetters } from 'vuex'
import { sessionNoteList } from '@/api/api'
import { deleteAction } from '@/api/manage'
export default {
  name: 'PaperOutline',
  components: {
    // IndexChart,
    // IndexTask,
    // IndexBdc
  },
  props: {
    model: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {
      models: this.model,
      confirmLoading: false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 12 },
      },
      validatorRules: {
        topic: [
          { required: true, message: '请输入论文题目' },
          { min: 1, max: 80, message: '长度在 1 到 80 个字符', trigger: 'blur' },
        ],
        keyword: [
          { required: true, message: '请输入论文关键词' },
          { min: 1, max: 80, message: '长度在 1 到 80 个字符', trigger: 'blur' },
        ],
      },
    }
  },
  created() {},
  computed: {},

  mounted() {},
  methods: {
    generatedBtnProp() {
      let obj = {
        topic: this.models.topic,
        keyword: this.models.keyword,
      }
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$emit('appApiAsk', 1, obj)
        } else {
          this.$emit('appApiAsk', 2, obj)
        }
      })
    },
  },
}
</script>

<style lang="less">
</style>